<script type="text/javascript" src="js/jquery.cookie.js"></script>
<script type="text/javascript" src="js/front-top.js"></script>


<div class="logo-l" style="float: right;" hidden="hidden">
    <a href="login.jsp">登&nbsp;录</a>&nbsp;&nbsp;|&nbsp;&nbsp;
    <a href="register.jsp">注&nbsp;册</a>
</div>
<div class="logo-h" hidden="hidden">
    <span class="logo-h-m" id="frontUserId" >codefox</span>&nbsp;
    <span class="logo-h-s"><img src="img/owl1.jpg" id="frontUserImg"></span> &nbsp;&nbsp;|&nbsp;&nbsp;
    <a onclick="reload()">退&nbsp;出</a>
</div>

<script>
    $(document).ready(function() {
        if(getRequest().adminName != null){
            setAdminName();
            $(".logo-l").hide();
            $(".logo-h").show();
            
        }else{
            $(".logo-h").hide();
            $(".logo-l").show();
        }
    })

    function getRequest() {
        var url = window.location.search; //获取url中"?"符后的字串
        var theRequest = new Object();
        if(url.indexOf("?") != -1) {
            var str = url.substr(1);
            strs = str.split("&");
            for(var i = 0; i < strs.length; i++) {
                theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
            }

        }

        return theRequest;
    }

    function setAdminName() {
        var tempKeyword = getRequest().adminName;
        var a = document.getElementById("frontUserId");

        if(tempKeyword != null) {
            a.innerHTML = tempKeyword;
//          alert(tempKeyword);

        }
    }
    
    function reload(){
        window.location.href = "index.html";
    }
</script>